# # 打开文件， 不存在的文件
# f = open("D:/test3.txt","a","UTF-8")

# # write 写入
# f.write("heimachengxuyuan")
# # flush 刷新
# f.flush()
# # close 关闭
# f.close()
# 打开一个存在的文件
f = open("D:/test3.txt","a","UTF-8")
# write写入，flush刷新
f.write("\nhello world")
f.flush()

# close 关闭
f.close()
